package com.hermes.intigration.db.dao.impl;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.hermes.intigration.db.dao.UserDAO;
import com.hermes.model.User;

public class UserDAOImpl extends SqlMapClientDaoSupport implements UserDAO {

	@Override
	public void delete(int id) {
		this.getSqlMapClientTemplate().delete("deleteUser", id);
	}

	@Override
	public void insert(User user) {
		this.getSqlMapClientTemplate().insert("insertUser", user);
	}

	@Override
	public User selectByPk(int id) {
		return (User) this.getSqlMapClientTemplate().queryForObject(
				"selectUser", id);
	}

	@Override
	public void update(User user) {
		this.getSqlMapClientTemplate().update("updateUser", user);
	}

}
